package com.bb.blog.biz.order;

import com.bb.blog.web.component.ResponseUtil;
import com.bb.blog.web.model.CommonResponse;
import com.google.common.collect.ImmutableList;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class Controller {
    @GetMapping("/test")
    public CommonResponse test(){
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

        return ResponseUtil.success(authentication);
    }

    @GetMapping("/order/list")
    public CommonResponse orderList(){
        List<String> orderList = ImmutableList.of("vegetable", "meat");
        return  ResponseUtil.success(orderList);
    }

}
